<template>
	<view>
		<view class="PLR_2 MTB_2">
		<view class="PTB_4 flex_rowL bg_fff BB_radius_10 H_40vw PL_6" style="border-radius: 5px !important;">
			<image @click="uOpenWin('./avatar')" class="WH_16vw B_radius_circle" :src="baseImg+user.avatar" mode=""></image>
			<view class="PL_2">
				<view class="flex_rowL">
					<view @click="uOpenWin('./reName')" class="font_weight_bold PLR_2 W_50vw text_overflow_1 fontS_17">
						{{user.name}}
					</view>
					<view @click="uOpenWin('./realName')" class="fontS_15 color_bgup B_radius_5 color_fff" style="padding: 0.5vw;">
						{{user.real_status?'已实名':'未实名'}}
					</view>
				</view>
				
				<view class="fontS_15 flex_rowL PT_1 PL_2">
					<view class="PR_2">
						{{user.mobile1}}
					</view>
					<view class="PL_2 color_gold vip flex_rowC">
						lv.{{user.level}}
					</view>
				</view>
			</view>
		</view>
		</view>
		
		<!-- <view class="PT_3 PB_2">
			<image style="width: 100%;height: 20vw;" src="../../static/logo.png" mode=""></image>
		</view> -->
		
		<view class="PLR_2 MTB_2">
			<view  class="bg_fff B_radius_5 PTB_3 flex_row_around H_32vw">
				<view style="width: 49%;" @click="uOpenWin('./walletManager?id='+1)" class="flex_colC">
					<view class="pub_color fontS_18 font_weight_bold">
						{{Number(nums.ksaAccount).toFixed(2)}}
					</view>
					<view class="flex_rowL">
						<view class="color_gray">
							可用：
						</view>
						<view class="">
							KSA
						</view>
					</view>
				</view>
				<view class="pub_bg H_8vw" style="width: 2px;">
				
				</view>
				<view style="width: 49%;" @click="uOpenWin('./walletManager?id='+2)" class="flex_colC">
					<view class="pub_color fontS_18 font_weight_bold">
						{{Number(nums.usdtAccount).toFixed(2)}}
					</view>
					<view class="flex_rowL">
						<view class="color_gray">
							可用：
						</view>
						<view class="">
							USDT
						</view>
					</view>
				</view>
			</view>
			
			
			<view class="MT_2 flex_row_between">
				<view @click="uOpenWin('./reword')" class="bg_fff W_46vw H_32vw B_radius_5 flex_rowL PTB_2 PL_2">
					<image class="W_14vw" src="../../static/tab4_icon1.png" mode="widthFix"></image>
					<view class="PL_2">
						<view class="pub_color fontS_18 font_weight_bold PB_2">
							{{Number(nums.todayBonus).toFixed(2)}}
						</view>
						<view style="display: flex;justify-content: flex-end;align-items: flex-end;">
							<view class="">
								今日奖励
							</view>
							<view class="fontS_12 color_gray PL_1">
								KAS
							</view>
						</view>
					</view>
				</view>
				
				<view @click="uOpenWin('./baby')" class="bg_fff W_46vw H_32vw B_radius_5 flex_rowL PTB_2 PL_2">
					<image class="W_14vw" src="../../static/tab4_icon2.png" mode="widthFix"></image>
					<view class="PL_2">
						<view class="pub_color fontS_18 font_weight_bold PB_2">
							{{Number(nums.user_money).toFixed(2)}}
						</view>
						<view style="display: flex;justify-content: flex-end;align-items: flex-end;">
							<view class="">
								币额宝
							</view>
							<view class="fontS_12 color_gray PL_1">
								KAS
							</view>
						</view>
					</view>
				</view>
			</view>
			
		</view>
		
		
		<view class="bg_fff B_radius_5 P_2 MLR_2">
			<view @click="uOpenWin('./cashIn')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p1.png" mode="widthFix"></image>
					<view class="PL_2">
						充值
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			<view @click="uOpenWin('./cashOut')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p2.png" mode="widthFix"></image>
					<view class="PL_2">
						提币
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			
			<view @click="uOpenWin('./cashIn')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p3.png" mode="widthFix"></image>
					<view class="PL_2">
						充值记录
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			<view @click="uOpenWin('./cashOut')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p4.png" mode="widthFix"></image>
					<view class="PL_2">
						提现记录
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			
			<view @click="uOpenWin('./record?name='+user.name)" class="PT_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_P41.png" mode="widthFix"></image>
					<view class="PL_2">
						撮合记录
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
		</view>
		
		<view class="bg_fff B_radius_5 P_2 MLR_2 MT_2" style="margin-bottom: 20px;">
			<view @click="uOpenWin('./share')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p5.png" mode="widthFix"></image>
					<view class="PL_2">
						分享好友
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			
			<view @click="uOpenWin('./bilist2')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p6.png" mode="widthFix"></image>
					<view class="PL_2">
						绑定钱包地址
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			
			<view @click="uOpenWin('./team')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p7.png" mode="widthFix"></image>
					<view class="PL_2">
						我的社区
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			
			<view @click="uOpenWin('./repass')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p8.png" mode="widthFix"></image>
					<view class="PL_2">
						修改密码
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			
			<view @click="uOpenWin('./repaypass')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p9.png" mode="widthFix"></image>
					<view class="PL_2">
						修改安全密码
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			
			<view v-if="user.real_status!=1" @click="checkPass('./realName')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p10.png" mode="widthFix"></image>
					<view class="PL_2">
						实名认证
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			
			<view v-else @click="checkPass('./hasReal')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p10.png" mode="widthFix"></image>
					<view class="PL_2">
						实名认证
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			
			<view @click="uOpenWin('./kefu')" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p11.png" mode="widthFix"></image>
					<view class="PL_2">
						联系客服
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
			
			<view @click="exit()" class="PTB_2 flex_row_between">
				<view class="flex_rowL">
					<image class="W_4vw" src="../../static/tab4_p12.png" mode="widthFix"></image>
					<view class="PL_2">
						退出登录
					</view>
					
				</view>
				<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
			</view>
		</view>
		
		<uni-popup ref="popup" type="center">
			<view class="W_60vw bg_fff B_radius_5">
				<view class="flex_rowC PTB_4">
					安全密码
				</view>
				<view class="PTB_1 MLR_5 flex_rowC MB_3 B_radius_5" style="border: 1px solid #C7C7C7;">
					<input class="textC" v-model="pass" type="password" value="" />
				</view>
				<view class="flex_row_between" style="border-top: 1px solid #cecece">
				  <view
					@click="$refs.popup.close()"
					class="flex_rowC PTB_3"
					style="width: 50%; border-right: 1px solid #cecece"
				  >
					取消
				  </view>
				  <view @click="goCheck()" style="width: 50%" class="flex_rowC color_red">
					确认
				  </view>
				</view>
			</view>
		</uni-popup>
		
		<!-- <view class="PLR_2">
		
		<view @click="uOpenWin('./bilist2')" class="bg_fff font_weight_bold P_2 B_radius_5 MT_2 flex_row_between">
			<view class="flex_rowL">
				<image class="W_4vw" src="../../static/tab4_1.png" mode="widthFix"></image>
				<view class="PL_2">
					提币地址管理
				</view>
				
			</view>
			<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
		</view>
		<view @click="uOpenWin('./realName')" class="bg_fff font_weight_bold P_2 B_radius_5 MT_2 flex_row_between">
			<view class="flex_rowL">
				<image class="W_4vw" src="../../static/tab4_2.png" mode="widthFix"></image>
				<view class="PL_2">
					实名认证
				</view>
				
			</view>
			<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
		</view>
		<view @click="uOpenWin('./share')" class="bg_fff font_weight_bold P_2 B_radius_5 MT_2 flex_row_between">
			<view class="flex_rowL">
				<image class="W_4vw" src="../../static/tab4_3.png" mode="widthFix"></image>
				<view class="PL_2">
					分享好友
				</view>
				
			</view>
			<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
		</view>
		
		<view @click="uOpenWin('./team')" class="bg_fff font_weight_bold P_2 B_radius_5 MT_2 flex_row_between">
			<view class="flex_rowL">
				<image class="W_4vw" src="../../static/tab4_4.png" mode="widthFix"></image>
				<view class="PL_2">
					我的团队
				</view>
				
			</view>
			<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
		</view>
		
		<view @click="uOpenWin('./cashIn')" class="bg_fff font_weight_bold P_2 B_radius_5 MT_2 flex_row_between">
			<view class="flex_rowL">
				<image class="W_4vw" src="../../static/tab4_5.png" mode="widthFix"></image>
				<view class="PL_2">
					充值记录
				</view>
				
			</view>
			<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
		</view>
		<view @click="uOpenWin('./cashOut')" class="bg_fff font_weight_bold P_2 B_radius_5 MT_2 flex_row_between">
			<view class="flex_rowL">
				<image class="W_4vw" src="../../static/tab4_6.png" mode="widthFix"></image>
				<view class="PL_2">
					提现记录
				</view>
				
			</view>
			<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
		</view>
		
		<view @click="uOpenWin('./record')" class="bg_fff font_weight_bold P_2 B_radius_5 MT_2 flex_row_between">
			<view class="flex_rowL">
				<image class="W_4vw" src="../../static/tab4_7.png" mode="widthFix"></image>
				<view class="PL_2">
					下注记录
				</view>
			</view>
			<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
		</view>
		
		<view @click="uOpenWin('./kefu')" class="bg_fff font_weight_bold P_2 B_radius_5 MT_2 flex_row_between">
			<view class="flex_rowL">
				<image class="W_4vw" src="../../static/tab4_8.png" mode="widthFix"></image>
				<view class="PL_2">
					客服
				</view>
				
			</view>
			
			<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
		</view>
		
		<view @click="exit" class="bg_fff font_weight_bold P_2 B_radius_5 MT_2 flex_row_between">
		
			<view class="flex_rowL">
				<image class="W_4vw" src="../../static/tab4_9.png" mode="widthFix"></image>
				<view class="PL_2">
					退出登录
				</view>
				
			</view>	
			
			<image class="W_4vw" src="../../static/goyou.png" mode="widthFix"></image>
		</view>
		</view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:{},
				nums:{},
				pass:'',
				jumpUrl:''
			}
		},
		onShow() {
			this.getUser();
			this.getNum();
		},
		onLoad() {
			this.getUser();
			this.getNum();
		},
		methods: {
			checkPass(i){
				this.jumpUrl = i;
				this.$refs.popup.open();
				
			},
			goCheck(){
				if(!this.pass){
					this.toast('请输入安全密码')
				}else{
					let _this = this;
					this.$req('user/checkPaypwd',{paypwd:_this.pass},function(res){
						_this.pass = ''
						_this.uOpenWin(_this.jumpUrl)
					})
				}
			},
			getNum(){
				let _this = this;
				this.$req('user/center',{},function(res){
					_this.nums = res.data;
				})
			},
			exit(){
				let _this = this;
				uni.removeStorage({
					key:'token',
					success() {
						uni.reLaunch({
							url:'../login/login'
						})
					}
				})
			},
			getUser(){
				let _this = this;
				this.$req('auth/me',{},function(res){
					_this.user = res.data;
				})
			}
		}
	}
</script>

<style>
/* .bg_top{
	background-image: url(../../static/tab4_top.png);
	background-size: 100% 100%;
	background-repeat: no-repeat;
} */
.bg_41{
	background-image: url(../../static/tab4_bg1.png);
	background-size: 100% 100%;
	background-repeat: no-repeat;
}
.bg_42{
	background-image: url(../../static/tab4_bg2.png);
	background-size: 100% 100%;
	background-repeat: no-repeat;
}
.vip{
	background-image: url(../../static/vip.png);
	background-size: 100% 100%;
	background-repeat: no-repeat;
	padding: 0.2vw 2vw;
}
</style>
